<?php
$id = isset($_GET['id'])?(int)$_GET['id']:0;
$lanmu = isset($_GET['lanmu'])?(int)$_GET['lanmu']:0;
$cid = isset($_GET['c_id'])?(int)$_GET['c_id']:0;

$where_sql=" where 1=1 ";
if($lanmu){
	$where_sql.=" and lanmu={$lanmu}";
}
if(!$c_id){
	$where_sql.=" order by c_sort_id  LIMIT 1";
}
else{
	$where_sql.= " and c_id = {$cid}";
}
$sql = "select * from ".lc()."_down_type ".$where_sql;
$rs = mysql_query($sql);
if($rs){
	$rows = mysql_fetch_assoc($rs);
	$lanmu=$rows['lanmu'];
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo top_keys(7)?></title>
<meta name="description" content="<?php echo top_keys(9)?>">
<meta name="keywords" content="<?php echo top_keys(8)?>">
<link href="<?php echo TPL_URL?>style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="body">
  <?php require('head.php')?>
  <div id="middle">
    <div id="left">
      <div id="type">
        <div class="title">
          <h1>栏目分类</h1>
        </div>
        <ul>
          <?php echo get_down_type_ul(0,0,$lanmu)?>
        </ul>
      </div>
      <!-- type --></div>
    <!-- left -->
    <div id="right">
      <div class="title">
        <h1><?php echo get_lanmu_name($lanmu)?></h1>
        <h3><a href="index.php">首页</a> > <?php echo $rows['c_title']?></h3>
      </div>
      <div id="down_list">
        <ul>
          <?php echo show_down_more_ul(10,$cid,$lanmu,80,1,0,$key)?>
        </ul>
        <div class="clear"></div>
      </div>
    </div>
    <!-- right -->
    <div class="clear"></div>
  </div>
  <?php require('bot.php') ?>
</div>
<!-- body --> 
<br>
</body>
</html>
